package doctor

import (
	"context"
	"go.uber.org/zap"
	"srv/config"
	"srv/internal/model/dao"
	__ "srv/proto"
)

// 实现方法
func (s *DoctorService) FindHao(ctx context.Context, req *__.FindHaoRequest) (resp *__.FindHaoResponse, err error) {
	var hao dao.Hao
	config.DB.Where("name=?", req.Name).Limit(1).Find(&hao)
	if hao.ID == 0 {
		zap.S().Error("没有该挂号信息")
	}
	return &__.FindHaoResponse{
		Name:        hao.Name,
		Hospital:    hao.Hospital,
		HospitalAdd: hao.HospitalAdd,
		Doctor:      hao.Doctor,
		Level:       hao.Level,
		Status:      hao.Status,
	}, nil
}
